package org.yate.oa.service.imp;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.yate.oa.dao.IBaseMapperDao;
import org.yate.oa.dao.mapper.TaskMapper;
import org.yate.oa.model.TaskEntity;
import org.yate.oa.service.ITaskService;
import org.yate.oa.utils.Pagination;

@Service
public class TaskService extends BaseService<TaskEntity, Integer> implements ITaskService {

	@Resource(name = "taskMapper")
	private TaskMapper taskDao;


	@Override
    public Pagination<TaskEntity> getEntitiesBy(int page, int rows, String orderField, String orderMode, String... strings) {
        Pagination<TaskEntity> result = new Pagination<TaskEntity>(page, rows);
        result.setRows(this.taskDao.getEntitiesBy(result, orderField, orderMode, strings));
        return result;
    }
	
	@Override
	protected IBaseMapperDao<TaskEntity, Integer> getMapperDao() {
		return this.taskDao;
	}

	@Override
	public Pagination<TaskEntity> getEntitiesByOrdId(int page, int rows, String orderField, String orderMode, String... strings) {
		Pagination<TaskEntity> result = new Pagination<TaskEntity>(page, rows);
		result.setRows(this.taskDao.getEntitiesByOrdId(result, orderField, orderMode, strings));
		return result;
	}

}
